package com.xiangxiangjd.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;

import com.xiangxiangjd.aop.DictData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 物品表
 *
 * @author 肖守凯
 * @since 2021-11-08
 */
@TableName("goods")
@ApiModel(value = "Goods对象", description = "物品表")
@Data
public class Goods extends Model<Goods> {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "id 物品id")
  @TableId(value = "id", type = IdType.ID_WORKER_STR)
  private String id;


  @ApiModelProperty(value = " (0在库/1调出/2已报废/3借出(校外))其他所属人id")
  @TableField("user_id")
  private String userId;

  @ApiModelProperty(value = "1航材 / 2耗材")
  @TableField("goods_type")
  private String goodsType;

  @ApiModelProperty(value = "物品名称")
  @TableField("goods_name")
  private String goodsName;

  @ApiModelProperty(value = "计量单位")
  @TableField("company")
  private String company;

  @ApiModelProperty(value = "耗材在库数量  ")
  @TableField("number")
  private String number;

  @ApiModelProperty(value = "规格型号")
  @TableField("model")
  private String model;

  @ApiModelProperty(value = "单价")
  @TableField("price")
  private String price;

  @ApiModelProperty(value = "增加原因")
  @TableField("reason")
  private String reason;

  @ApiModelProperty(value = "备注")
  @TableField("remarks")
  private String remarks;

  @ApiModelProperty(value = "实体图片 ")
  @TableField("entity_img_url")
  private String entityImgUrl;

  @ApiModelProperty(value = "相关凭证")
  @TableField("voucher_img_url")
  private String voucherImgUrl;

  @ApiModelProperty(value = "相关凭证名称")
  @TableField("voucher_img_name")
  private String voucherImgName;

  @ApiModelProperty(value = "实体图片名称")
  @TableField("entity_img_name")
  private String entityImgName;

  @ApiModelProperty(value = "日期单号（关联 date_no_id）")
  @TableField("date_no_id")
  private Integer dateNoId;

  @ApiModelProperty(value = "耗材登记数量")
  @TableField("init_number")
  private Double initNumber;


  @ApiModelProperty(value = "保管人(责任人)")
  @TableField("p_liable")
  private String pLiable;

  //测试属性
  //@ApiModelProperty(value = "保管人(责任人)")
  @TableField(exist = false)
  private String liable;


  @ApiModelProperty(value = "存放地点")
  @TableField("deposit_address")
  private String depositAddress;


  @ApiModelProperty(value = "处置原因")
  @TableField("management_info")
  private String managementInfo;

  @DictData(dictDataType = "获取方式")
  @ApiModelProperty(value = "获取方式（下拉选）")
  @TableField(exist = false)
  private String assetsSource;

  @TableField(exist = false)
  private String sumMoney;

  // 所属单号
  @ApiModelProperty(value = "所属单号")
  @TableField(exist = false)
  private DateNo dateNo;

  @ApiModelProperty(value = "航材数量")
  @TableField(exist = false)
  private String count;

  @TableField(exist = false)
  private String page;

  @ApiModelProperty(value = "申领单位")
  @TableField(exist = false)
  private String applicantName;

  @ApiModelProperty(value = "申领日期")
  @TableField(exist = false)
  private String claimCreateTime;

  @ApiModelProperty(value = "交接日期")
  @TableField(exist = false)
  private String handoverCreateTime;

  @ApiModelProperty(value = "申领单位名称")
  @TableField(exist = false)
  private String claimUnitName;

  @ApiModelProperty(value = "交接单位名称")
  @TableField(exist = false)
  private String handoverUnitName;


  @ApiModelProperty(value = "获取日期")
  @TableField(exist = false)
  private String purchaseDate;

  @ApiModelProperty(value = "所属人")
  @TableField(exist = false)
    private String username;

  @ApiModelProperty(value = "所属单位")
  @TableField(exist = false)
  private String unitName;

  @ApiModelProperty(value = "所属单位id")
  @TableField(exist = false)
  private String unitId;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Goods goods = (Goods) o;
    return Objects.equals(userId, goods.userId) &&
            Objects.equals(goodsType, goods.goodsType) &&
            Objects.equals(goodsName, goods.goodsName) &&
            Objects.equals(company, goods.company) &&
            Objects.equals(number, goods.number) &&
            Objects.equals(model, goods.model) &&
            Objects.equals(price, goods.price) &&
            Objects.equals(reason, goods.reason) &&
            Objects.equals(remarks, goods.remarks) &&
            Objects.equals(entityImgUrl, goods.entityImgUrl) &&
            Objects.equals(voucherImgUrl, goods.voucherImgUrl) &&
            Objects.equals(voucherImgName, goods.voucherImgName) &&
            Objects.equals(entityImgName, goods.entityImgName) &&
            Objects.equals(dateNoId, goods.dateNoId) &&
            Objects.equals(initNumber, goods.initNumber) &&
            Objects.equals(pLiable, goods.pLiable) &&
            Objects.equals(liable, goods.liable) &&
            Objects.equals(depositAddress, goods.depositAddress) &&
            Objects.equals(managementInfo, goods.managementInfo) &&
            Objects.equals(assetsSource, goods.assetsSource) &&
            Objects.equals(sumMoney, goods.sumMoney) &&
            Objects.equals(dateNo, goods.dateNo) &&
            Objects.equals(count, goods.count) &&
            Objects.equals(page, goods.page) &&
            Objects.equals(applicantName, goods.applicantName) &&
            Objects.equals(claimCreateTime, goods.claimCreateTime) &&
            Objects.equals(handoverCreateTime, goods.handoverCreateTime) &&
            Objects.equals(claimUnitName, goods.claimUnitName) &&
            Objects.equals(handoverUnitName, goods.handoverUnitName) &&
            Objects.equals(purchaseDate, goods.purchaseDate) &&
            Objects.equals(username, goods.username) &&
            Objects.equals(unitName, goods.unitName) &&
            Objects.equals(unitId, goods.unitId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(userId, goodsType, goodsName, company, number, model, price, reason, remarks, entityImgUrl, voucherImgUrl, voucherImgName, entityImgName, dateNoId, initNumber, pLiable, liable, depositAddress, managementInfo, assetsSource, sumMoney, dateNo, count, page, applicantName, claimCreateTime, handoverCreateTime, claimUnitName, handoverUnitName, purchaseDate, username, unitName, unitId);
  }
}
